/*
 * Author: Alvin
 * Modified By: Alvin
 * Created Date: 2024-05-10 10:10:55
 * Last Modified: 2024-05-10 11:31:49
 * Description:
 */

enum WidgetType {
  searchBarListView(value: 1), //带搜索栏列表
  singleListView(value: 2), // 单列表
  tabBarListView(value: 3), //带tabBar列表
  singleForm(value: 4), // 单表单
  tabBarForm(value: 5); // 带tabBar表单

  final int value;

  const WidgetType({required this.value});

  factory WidgetType.fromType(int type) {
    switch (type) {
      case 1:
        return WidgetType.searchBarListView;
      case 2:
        return WidgetType.singleListView;
      case 3:
        return WidgetType.tabBarListView;
      case 4:
        return WidgetType.singleForm;
      case 5:
        return WidgetType.tabBarForm;

      default:
        return WidgetType.searchBarListView;
    }
  }
}
